package il.ac.braude.sona.gui.infogui;

import il.ac.braude.sona.gui.SONAFrame;

import java.awt.Component;
/**
 * This Class represents a frame that has InfoPanel to fiil with info rows
 * @author  Ofek Ron
 * @author Avihay Avitan
 * @author Nitzan Inbar
 * @author Sasha Rozenthal
 * Laboratory in Software Engineering,Ort Braude College.</p>
 *
 */
public class InfoFrame extends SONAFrame {
	private InfoPanel infoPanel = new InfoPanel();
	
	public InfoFrame(String title) {
		setTitle(title);
	}
	/**
	 * sets info panel
	 * @param panel
	 */
	public void setInfoPanel(InfoPanel panel) {
		getContentPane().remove(infoPanel);
		getContentPane().add(infoPanel=panel);
	}
	/**
	 * 
	 * @return info panel
	 */
	public InfoPanel getInfoPanel(){
		return infoPanel;
	}
	/**
	 * adds a title on top of this frame
	 * @param string
	 */
	public void addTitleWithUnderline(String string) {
		infoPanel.addTitleWithUnderline(string);
	}
	/**
	 * add info row
	 * @param key
	 * @param value
	 */
	public void addInfoRow(String key, String value) {
		infoPanel.addInfoRow(key, value);
	}
	/**
	 * 
	 * @param key
	 * @param value
	 */
	public void addInfoRow(String key, Component value) {
		infoPanel.addInfoRow(key, value);
	}
}
